USE BDM

----	NOTE when running this script you will drop and recreate all tables, 
----	You will need to repopulate theses tables with the information.

GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[file_location]') AND type in (N'U'))
DROP TABLE [dbo].[file_location]
GO
CREATE TABLE [dbo].[file_location](
	[id_val] [int] IDENTITY(1,1) NOT NULL,
	[file_location] [varchar](2000) NULL
) ON [PRIMARY]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[file_type]') AND type in (N'U'))
DROP TABLE [dbo].[file_type]
GO
CREATE TABLE [dbo].[file_type](
	[id_val] [int] IDENTITY(1,1) NOT NULL,
	[file_type] [varchar](2000) NULL
) ON [PRIMARY]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[KWlvl]') AND type in (N'U'))
	DROP TABLE [dbo].[KWlvl]
	create table KWlvl ( 
	id_val int,
	kw_strt varchar(200), 
	pos int ) 
	
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[KW]') AND type in (N'U'))
	DROP TABLE [dbo].[KW]
CREATE TABLE [dbo].[KW](
	[id_val] [int] IDENTITY(1,1) NOT NULL,
	[kw_strt] [varchar](max) NULL,
	[kw_end] [varchar](max) NULL,
	[kw_desc] [varchar](max) NULL,
	[len_kw_end] [int] NULL
) ON [PRIMARY]
GO




